package Lesson14;

public class CarDemo {

	public static void main(String[] args) {
		Car c1 = new Car();
		Car c2 = new Car();
		Person krasi = new Person();
		krasi.age = 27;
		krasi.name = "Krasi";
		Person gosho = new Person();
		gosho.age = 24;
		gosho.name = "Georgi";
		
		
		c1.model = "Ferrari F430";
		c1.maxSpeed = 320;
		c1.currentSpeed = 200;
		c1.color = "Red";
		c1.currentGear = 4;
		c1.owner = krasi;

		
		
		c2.model = "Skoda Octavia";
		c2.maxSpeed = 240;
		c2.currentSpeed = 60;
		c2.color = "Silver";
		c2.currentGear = 5;
		c2.owner = gosho;
		
		
		System.out.println("The first car is " + c1.model);
		System.out.println("The max speed of the first car is " + c1.maxSpeed);
		System.out.println("The current speed of the first car is " + c1.currentSpeed);
		System.out.println("The color of the first car is " + c1.color);
		System.out.println("The current gear of the first car is " + c1.currentGear);
		System.out.println("The owner of the first car is " + c1.owner.name + " of age " + c1.owner.age);

		System.out.println();
		
		c2.currentSpeed+=20;
		
		System.out.println("The second car is " + c2.model);
		System.out.println("The max speed of the second car is " + c2.maxSpeed);
		System.out.println("The current speed of the second car is " + c2.currentSpeed);
		System.out.println("The color of the second car is " + c2.color);
		System.out.println("The current gear of the second car is " + c2.currentGear);
		System.out.println("The owner of the first car is " + c2.owner.name + " of age " + c2.owner.age);
		
		c1.accelerate();
		c1.accelerate();
		c1.changeColor("Blue");
		c1.changeGearUp();
		
		c2.accelerate();
		c2.changeColor("Yellow");
		c2.changeGear(3);
		
		System.out.println(c1.currentSpeed);
		System.out.println(c1.color);
		System.out.println(c1.currentGear);
		System.out.println();
		System.out.println(c2.currentSpeed);
		System.out.println(c2.color);
		System.out.println(c2.currentGear);
		
	}

}
